Optimal. Leaf size=112 \[ a b (A+2 C) x+\frac {b^2 C \tanh ^{-1}(\sin (c+d x))}{d}+\frac {\left (2 A b^2+a^2 (2 A+3 C)\right ) \sin (c+d x)}{3 d}+\frac {a A b \cos (c+d x) \sin (c+d x)}{3 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.20, antiderivative size = 112, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {4180, 4159,
4132, 8, 4130, 3855} \begin {gather*} \frac {\left (a^2 (2 A+3 C)+2 A b^2\right ) \sin (c+d x)}{3 d}+\frac {a A b \sin (c+d x) \cos (c+d x)}{3 d}+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}+a b x (A+2 C)+\frac {b^2 C \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3855
Rule 4130
Rule 4132
Rule 4159
Rule 4180
Rubi steps
\begin {align*} \int \cos ^3(c+d x) (a+b \sec (c+d x))^2 \left (A+C \sec ^2(c+d x)\right ) \, dx &=\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d}+\frac {1}{3} \int \cos ^2(c+d x) (a+b \sec (c+d x)) \left (2 A b+a (2 A+3 C) \sec (c+d x)+3 b C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a A b \cos (c+d x) \sin (c+d x)}{3 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d}-\frac {1}{6} \int \cos (c+d x) \left (-2 \left (2 A b^2+a^2 (2 A+3 C)\right )-6 a b (A+2 C) \sec (c+d x)-6 b^2 C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a A b \cos (c+d x) \sin (c+d x)}{3 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d}-\frac {1}{6} \int \cos (c+d x) \left (-2 \left (2 A b^2+a^2 (2 A+3 C)\right )-6 b^2 C \sec ^2(c+d x)\right ) \, dx+(a b (A+2 C)) \int 1 \, dx\\ &=a b (A+2 C) x+\frac {\left (2 A b^2+a^2 (2 A+3 C)\right ) \sin (c+d x)}{3 d}+\frac {a A b \cos (c+d x) \sin (c+d x)}{3 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d}+\left (b^2 C\right ) \int \sec (c+d x) \, dx\\ &=a b (A+2 C) x+\frac {b^2 C \tanh ^{-1}(\sin (c+d x))}{d}+\frac {\left (2 A b^2+a^2 (2 A+3 C)\right ) \sin (c+d x)}{3 d}+\frac {a A b \cos (c+d x) \sin (c+d x)}{3 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.26, size = 144, normalized size = 1.29 \begin {gather*} \frac {12 a A b c+24 a b c C+12 a A b d x+24 a b C d x-12 b^2 C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 b^2 C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+3 \left (4 A b^2+a^2 (3 A+4 C)\right ) \sin (c+d x)+6 a A b \sin (2 (c+d x))+a^2 A \sin (3 (c+d x))}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 106, normalized size = 0.95
method | result | size |
derivativedivides | \(\frac {A \,b^{2} \sin \left (d x +c \right )+b^{2} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 a A b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 a b C \left (d x +c \right )+\frac {A \,a^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+a^{2} C \sin \left (d x +c \right )}{d}\) | \(106\) |
default | \(\frac {A \,b^{2} \sin \left (d x +c \right )+b^{2} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 a A b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 a b C \left (d x +c \right )+\frac {A \,a^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+a^{2} C \sin \left (d x +c \right )}{d}\) | \(106\) |
risch | \(a A b x +2 a b x C -\frac {3 i A \,a^{2} {\mathrm e}^{i \left (d x +c \right )}}{8 d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} A \,b^{2}}{2 d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} a^{2} C}{2 d}+\frac {3 i A \,a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{8 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} A \,b^{2}}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a^{2} C}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2} C}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2} C}{d}+\frac {A \,a^{2} \sin \left (3 d x +3 c \right )}{12 d}+\frac {a A b \sin \left (2 d x +2 c \right )}{2 d}\) | \(205\) |
norman | \(\frac {\left (-a A b -2 a b C \right ) x +\left (-3 a A b -6 a b C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (a A b +2 a b C \right ) x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a A b +6 a b C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {4 \left (A \,a^{2}-a A b -A \,b^{2}-a^{2} C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 \left (A \,a^{2}-a A b +A \,b^{2}+a^{2} C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 \left (A \,a^{2}+a A b -A \,b^{2}-a^{2} C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 \left (A \,a^{2}+a A b +A \,b^{2}+a^{2} C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {2 \left (7 A \,a^{2}-9 a A b +3 A \,b^{2}+3 a^{2} C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {2 \left (7 A \,a^{2}+9 a A b +3 A \,b^{2}+3 a^{2} C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}+\frac {b^{2} C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {b^{2} C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(387\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 112, normalized size = 1.00 \begin {gather*} -\frac {2 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a^{2} - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a b - 12 \, {\left (d x + c\right )} C a b - 3 \, C b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 6 \, C a^{2} \sin \left (d x + c\right ) - 6 \, A b^{2} \sin \left (d x + c\right )}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.32, size = 99, normalized size = 0.88 \begin {gather*} \frac {6 \, {\left (A + 2 \, C\right )} a b d x + 3 \, C b^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, C b^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (A a^{2} \cos \left (d x + c\right )^{2} + 3 \, A a b \cos \left (d x + c\right ) + {\left (2 \, A + 3 \, C\right )} a^{2} + 3 \, A b^{2}\right )} \sin \left (d x + c\right )}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + C \sec ^{2}{\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cos ^{3}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 256 vs.
\(2 (106) = 212\).
time = 0.48, size = 256, normalized size = 2.29 \begin {gather*} \frac {3 \, C b^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, C b^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + 3 \, {\left (A a b + 2 \, C a b\right )} {\left (d x + c\right )} + \frac {2 \, {\left (3 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 2 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.81, size = 170, normalized size = 1.52 \begin {gather*} \frac {3\,A\,a^2\,\sin \left (c+d\,x\right )}{4\,d}+\frac {A\,b^2\,\sin \left (c+d\,x\right )}{d}+\frac {C\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {2\,C\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {2\,A\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,C\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________